<%@page import="com.tubeonfire.entity.Playlist"%>
<%@page import="com.tubeonfire.model.admin.PlaylistModel"%>
<%@page import="com.tubeonfire.entity.Mission"%>
<%@page import="java.util.TreeMap"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%		
	Mission obj = (Mission)session.getAttribute("obj");	
	PlaylistModel plModel = new PlaylistModel();
	plModel.prepareAll(true);
	TreeMap check = (TreeMap)session.getAttribute("check");
	session.removeAttribute("check");
	if(check==null){
		check = new TreeMap();
	}
%>
<jsp:include page="/admin/elements/header.jsp">
	<jsp:param value="Mission Form" name="title"/>
</jsp:include>
<script type="text/javascript" src="/admin/js/mine/form_mission.js"></script>
	<body class="loggedin">
		<jsp:include page="/admin/elements/top.jsp"/>
	    <!-- START OF MAIN CONTENT -->
	    <div class="mainwrapper">
	     	<div class="mainwrapperinner">         	        
				<jsp:include page="/admin/elements/left.jsp">
					<jsp:param value="mission" name="current_page"/>
				</jsp:include>					              	                   
	        	<div class="maincontent noright">
	        		<div class="maincontentinner">	            	
		                <ul class="maintabmenu">
		                	<li><a href="/admin/mission/list">Manage Mission</a></li>
		                	<li class="current"><a href="#">
		                		New Mission  
                			</a></li>
		                </ul><!--maintabmenu-->	                
	                	<div class="content">	
	                	<jsp:include page="/admin/elements/message.jsp"/>	                    
	                    	<div class="contenttitle">
	                    		<h2 class="image"><span>Fill Mission Information</span></h2>
	                    	</div>
	                    	<br />
		                    <form class="stdform" action="/admin/mission/add" method="post" id="categoryForm">	
		                    	<p>
		                        	<label>Type</label>
		                            <select class="radius3" id="type" name="type" style="min-width: 18%">
		                            	<option value="2" <%=obj.getType()==2?"selected":"" %>>Transport</option>					                    	
				                    	<option value="1" <%=obj.getType()==1?"selected":"" %>>Follow</option>				                    					                    
				                    </select> &nbsp;
				                    <small class="desc" id="desc">This is subcription desc</small>				                    
		                        </p>  	                                   
		                        <p>
		                        	<label>From Channel Id</label>
		                            <span class="field">
		                            	<input type="text" name="channelId" class="smallinput" value="<%=obj.getSearchKeyword()%>"/>
		                            	<% if (check.get("channelId") != null) { %>
											<label for="channelId" class="error"><%=check.get("channelId") %></label>
										<% } %>
		                            </span>		
		                            <small class="desc"></small>                            		                           
		                        </p>     
		                        <p id="playlist">
									<label>Playlist to add </label>
									<%
	                                    	if(plModel!=null){
	                                    %>
									<span class="field">
										<select name="playlistId">
												<%
							                    		for(Playlist pl : plModel.getListResult()){			                    						                    		
							                    	%>
												<option <%=(obj.getPlaylistId().equals(pl.getId())?"selected":"") %> value="<%=pl.getId()%>"><%=pl.getTitle() %></option>
												<%
							                			}
							                    %>
										</select>	
										<span style="opacity:0.6">or <a href="/admin/playlist/add" title="Create new playlist">create new</a></span>
									</span>
									<%
	                                    	}
	                                    %>
								</p>                                                                 		                          		                                         		                                                                                                                                                                                  		           
		                        <p class="stdformbutton">
		                        	<button class="submit radius2" id="btnSubmit">Submit</button>
		                            <input type="reset" class="reset radius2" value="Reset" />
		                        </p>                                                
                    		</form>             
	                    <br /><br />	                    
	                </div><!--content-->	                
	            </div><!--maincontentinner-->
				<jsp:include page="/admin/elements/bottom.jsp"></jsp:include>                    	           	
	        </div><!--maincontent-->	                        
	     	</div><!--mainwrapperinner-->
	    </div><!--mainwrapper-->
		<!-- END OF MAIN CONTENT -->   
		<div id="opacity"></div>
		<img id="image_loadder" src="/admin/images/ajax-loader.gif">     
	</body>
</html>
